package com.yuanlrc.base.dao.admin;

import com.yuanlrc.base.entity.admin.Library;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface LibraryDao extends JpaRepository<Library,Long> {
    /**
     * 按照书屋名查找书屋信息
     * @param libraryName
     * @return
     */
    public Library findByLibraryName(String libraryName);

    /**
     * 根据用户id查询
     * @param id
     * @return
     */
    @Query("select l from Library l where id = :id")
    public Library find(@Param("id")Long id);

}
